package com.etc.mapper;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import com.etc.entity.User;

import tk.mybatis.mapper.common.Mapper;

/**
 * 通用UserMapper
 * 
 * @author 林子航
 *
 */
@Repository
public interface UserMapper extends Mapper<User> {

	/**
	 * 登录功能
	 * 
	 * @param username
	 * @param pwd
	 * @return
	 */
	
	@Select("select * from user where  uName=#{uName}  AND uPwd=#{uPwd}")
	User login(@Param("uName") String uName,
			 @Param("uPwd") String uPwd);

	/**
	 * 注册的验证用户名是否存在功能
	 */
	
	@Select("select * from user where  uName=#{uName} ")
	User chackname(@Param("uName") String uName);

	/**
	 * 注册的验证用户邮箱是否存在功能
	 */
	
	@Select("select * from user where  uEmail=#{uEmail} ")
	User chackEmai(@Param("uEmail") String uEmail);
	/**
	 * 注册的验证用户手机是否存在功能
	 */

	@Select("select * from user where  uTel=#{uTel} ")
	User chackuserTel(@Param("uTel") String uTel);

}
